package xyz.xtt.equity.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import xyz.xtt.equity.entity.TblUserBenefitChangeRecord;
import xyz.xtt.equity.mapper.TblUserBenefitChangeRecordMapper;
import xyz.xtt.equity.service.ITblUserBenefitChangeRecordService;

/**
 * <p>
 * 用户权益变动记录表 服务实现类
 * </p>
 *
 * @author dale
 * @since 2025-02-10
 */
@Service
public class TblUserBenefitChangeRecordServiceImpl extends ServiceImpl<TblUserBenefitChangeRecordMapper, TblUserBenefitChangeRecord>
		implements ITblUserBenefitChangeRecordService {

	@Override
	public List<TblUserBenefitChangeRecord> queryUserBenefitChangeRecords(long appUserId, int changeType, Long operateBusinessId) {
		LambdaQueryChainWrapper<TblUserBenefitChangeRecord> queryChainWrapper = new LambdaQueryChainWrapper<>(baseMapper);
		return queryChainWrapper
				.eq(TblUserBenefitChangeRecord::getAppUserId, appUserId)
				.eq(TblUserBenefitChangeRecord::getChangeType, changeType)
				.eq(TblUserBenefitChangeRecord::getOperateBusinessId, operateBusinessId)
				.list();
	}
}
